package com.langfeiyes.pattern.iterator;

import java.util.Arrays;
import java.util.List;

public class App {

    public static void main(String[] args) {

        List<String> elements = Arrays.asList("a", "b", "c", "d");

        Aggregate aggregate = new ConcreteAggregate(elements);

        Iterator iterator = aggregate.iterator();

        while(iterator.hasNext()){
            Object next = iterator.next();
            System.out.println(next);
        }


    }
}
